package code.vo {

[Bindable]
public class NeededTopic extends Topic {
	
	public var neededTopicId: int;
	
	public var categoryId: int;
	
	public function NeededTopic(topicId: int, title: String, voteCnt: int, yetVoted: Boolean, neededTopicId: int, categoryId: int) {
		super(topicId, title, voteCnt, yetVoted);
		
		this.neededTopicId = neededTopicId;
		this.categoryId = categoryId;
	}

	public static function newByXml(ntopic: Object): NeededTopic {
		return new NeededTopic(
			int(ntopic.TopicId),
			String(ntopic.Title),
			int(ntopic.Vote.VoteCnt),
			int(ntopic.Vote.YetVoted) == 1,
			int(ntopic.NeededTopicId),
			int(ntopic.CategoryId)
		);
	}
}
}